<template>
	<view>空白页</view>
</template>

<script setup>
import { reactive } from 'vue';
import { onLoad } from '@dcloudio/uni-app';
import initApi from '@/apis/init.js';
//http://localhost:5173/pages/gansuUnitMember/gansuUnitMember?p=CL0131
const router = reactive({
	paths: [
		//http://h5.zzqz2024.com/pages/clb/108?p=CL0108&a=
		{
			productCode: 'CL0108', // 重庆移动（犇德） 67add3e297f44fd2b253f846cbdb1eef
			path: '/pages/chongQing/chongQing',
			channelCode: ''
		},
		//http://h5.zzqz2024.com/pages/clb/119?p=CL0119&a=
		{
			productCode: 'CL0119', // 河南移动-15元享50G（HZJ）
			path: '/pages/henan-15/henan-119',
			channelCode: ''
		},
		//http://h5.zzqz2024.com/pages/clb/129?p=CL0129&a=
		{
			productCode: 'CL0129', //车主会员(平安版)）
			path: '/pages/index/index',
			channelCode: ''
		},
			//http://h5.zzqz2024.com/pages/clb/130?p=CL0130&a=
		{
			productCode: 'CL0130', // 河南移动-15元享50G（HZJ
			path: '/pages/henan-15/henan-15',
			channelCode: ''
		},
		{
			productCode: 'CL0131', // 移动-甘肃饭票联合会员 67add3e297f44fd2b253f846cbdb1eef
			path: '/pages/gansuUnitMember/gansuUnitMember',
			channelCode: ''
		},
		{
			productCode: 'CL0132', // 海南移动-椰岛随心看PLUS版
			path: '/pages/hainanMobileIsland/hainanMobileIsland',
			channelCode: ''
		},

	]
});

const test = () => {
	setTimeout(() => {
		uni.setNavigationBarTitle({
			title: '移动-甘肃饭票联合会员'
		});
	}, 500);
};
onLoad((query) => {
	const { p } = query;
	const arr = objectToQueryString(query);
	console.log(p);
	if (p) {
		const path = router.paths.filter((it) => it.productCode == p);
		if (path && path.length > 0) {
			uni.reLaunch({
				url: path[0].path + arr
			});
		}
	}
});
const objectToQueryString = (obj) => {
	return (
		'?' +
		Object.entries(obj)
			.map(([key, value]) => `${key}=${value}`)
			.join('&')
	);
};
</script>

<style></style>
